package cs348a.io;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.List;

import cs348a.data.Site;

public class SequenceWriter {
	static public void writeSiteFile(List<Site> siteList, String fileName) {
		File file = new File(fileName);
		Writer output = null;
		
		try {
			output = new BufferedWriter(new FileWriter(file));
			
			for(Site s : siteList) {
				int i = s.index > -1 ? 1 : 0;
				
				output.write(new String(s.x+"\t"+s.y+"\t"+s.z+"\t"+i+"\r\n"));
				
			}
			
			output.close();
		} catch (IOException e) {
			e.printStackTrace();
		}		
	}
}
